import 'dart:io';

import 'package:flutter/material.dart';

void main() {
  runApp(new CheckboxListTilePlugin());
}

/*
 * 多复选框组件 <br/>
 * 需要传入的键：<br/>
 * 传入的值类型： <br/>
 * 传入的值含义：<br/>
 * 是否必传 ：
 */
class CheckboxListTilePlugin extends StatefulWidget {
  State<StatefulWidget> createState() {
    return new CheckboxListTilePluginState();
  }
}

/*
 * 页面功能 <br/>
 */
class CheckboxListTilePluginState extends State<StatefulWidget> {
  bool check = true;

  void initState() {
    super.initState();
  }

  Widget build(BuildContext context) {
    AppBar appBar = AppBar(
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back),
        onPressed: () {},
      ),
      title: new Text('FlutterDesign'),
      centerTitle: true,
      actions: <Widget>[
        new Container(width: 0, height: 0),
        new Container(width: 0, height: 0),
      ],
      backgroundColor: Colors.blue,
    );

    return MaterialApp(
      home: new Scaffold(
        appBar: appBar,
        body: new Builder(builder: (BuildContext context) {
          return CheckboxListTile(
            value: false,
            onChanged: (isCheck) => {print("isCheck===$isCheck")},
            activeColor: Colors.red,
            title: Text('这是title'),
            subtitle: Text('这是描述'),
            //是否要撑满3行
            isThreeLine: false,
            //是否密集
            dense: false,
            secondary: CircleAvatar(
              child: Icon(Icons.android),
            ),
            selected: true,
            controlAffinity: ListTileControlAffinity.platform,
          );
        }),
        backgroundColor: Colors.white,
        bottomNavigationBar: null,
      ),
    );
  }
}
